<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";

	if(isset($_POST['btnsubmit']))
	{
		require("required/dbconnect.php");
				
		$email_host=$_POST['email_host'];
		$email_username=$_POST['email_username'];
		$email_password=$_POST['email_password'];
		$email_fromname=$_POST['email_fromname'];
		$email_reply=$_POST['email_reply'];
		
		
		$update=mysql_query("update os_contactinfo set 
		email_host='$email_host',email_username='$email_username',email_password='$email_password',email_fromname='$email_fromname',email_reply='$email_reply'
		where id=1")or die(mysql_error());
		//echo "update os_contactinfo set contact_number='$contact_number',email='$email',email_hidden='$email_hidden',address1='$address1',address2='$address2',fax='$fax',website='$website',website_name='$website_name',logo_url='$logo_url',cc_gatewayurl='$cc_gatewayurl',cc_verifykey='$cc_verifykey',cc_username='$cc_username',cc_returnurl='$cc_returnurl',paypal_emailaddress='$paypal_emailaddress',paypal_submit_url='$paypal_submit_url',cc_allowed='$cc_allowed',paypal_allowed='$paypal_allowed' where id=1";
		
		header("Location:sys_email.php?msg=1");
	}
	
	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
	checkAccess("allow_content_management",1);
?>
<script src="required/js/jquery-1.4.2.js"></script>
<script src="required/js/common_javascript.js"></script>
<?
	if(empty($_GET['msg']))
	{
		$msg="";
	}
	else
	{
		$msg="<div class='dw_success'>Data updated!</div>";
		echo "<script>displayMsg('divMsg')</script>";	
	}
	
	
	$get_info=mysql_query("select * from os_contactinfo where id=1");
	
	$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	
	<td valign="top">
			<div id="divMsg"><?= $msg ?></div>
			<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
			<table width="100%" >
				
				<tr>
					<td colspan="3" class="title">
					
					System Email Settings				
					</td>
				</tr>
				<tr>
					<td>Host </td><td width="66%"><input type="text" value="<?= $a['email_host'] ?>" name="email_host" maxlength="100" size="50"></td>
				</tr>
				<tr>
					<td>Username</td><td width="66%"><input type="text" value="<?= $a['email_username'] ?>" name="email_username" maxlength="100" size="20"></td>
				</tr>
				<tr>
					<td>Password</td><td width="66%"><input type="password" value="<?= $a['email_password'] ?>" name="email_password" maxlength="50" size="20"></td>
				</tr>
				
				<tr>
					<td>From Name</td><td><input type="text" value="<?= $a['email_fromname'] ?>" name="email_fromname" maxlength="20" size="50"></td>
				</tr>
				<tr>
					<td>From Email </td>
					<td><input type="text" value="<?= $a['email_reply'] ?>" name="email_reply" maxlength="100" size="50"></td>
				</tr>
				
				
			
				<td width="34%">
					
					<input type="submit" value="Save" class="button" name="btnsubmit">
				</td>
			</table>
			</form>
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

